#!/usr/bin/perl
#This function prints final result for cases involving the OUTPUT chain.
sub pass_or_fail_for_op_chain{
	my($tc_s_or_f,$setup_s_or_fail,$tc_id,$index_for_count,$cmd_fail,$cmd_fail_flag) = @_;
	$flag_NA = 0;
	$flag_FAIL = 0;
	$flag_PASS = 0;
	$flag_NA_Setup = 0;
	$flag_NA = 0;
	$flag_NA_ping = 0;
	if ($setup_s_or_fail == 2){
		print("Result: N.A.\n");
		$flag_NA = 1;
		$flag_NA_Setup = 1;
	}
	if ($cmd_fail == 2){
		print("Result: N.A.\n");
		$flag_NA = 1;
		$flag_NA_ping = 1;
	}
	if ($cmd_fail_flag == 2){
		print("Result: N.A.\n");
		$flag_NA = 1;
		$flag_NA_ping = 1;
	}
	if ($flag_NA == 0){
		if ($tc_s_or_f == 1){
			print("Result: Test case PASSED\n\n");
			$flag_PASS = 1;
		}
		else{
			print("Result: Test case FAILED\n\n");
			$flag_FAIL = 1;
		}
	}
	if ($flag_NA_Setup == 1){
		$finrep = "Test case ID: $tc_id --> N.A. Reason: Table not configured properly"
	}
	if ($flag_NA_ping == 1){
		$finrep = "Test case ID: $tc_id --> N.A. Reason: Not able to send ping"
	}
	if ($flag_PASS == 1){
		$finrep = "Test case ID: $tc_id --> PASS";
	}
	$index_for_count = $index_for_count + 1;
	return($finrep,$index_for_count);
}
1;
